package org.bao.bestmatch;

import java.util.LinkedList;

import org.bao.bestmatch.model.Matrix;
import org.bao.bestmatch.model.TFT_CFPair;

/**
 * program starts here.
 * @author baoxiwu<bb@feijiao.info>,Cell&Module,BOE DT
 * @version 0.9.0
 * @since 2010-11-22
 * @license LGPL
 * 
 */
public class Runner {
	public static String[] result = null;
	public static LinkedList<TFT_CFPair> pair = null;
	
	private Runner(){
	//empty	
	}
	
	
	public static boolean run(String path){
		MatrixGen mg = new MatrixGen(path);
		Matrix matrix = mg.gen();
		
		if(matrix == null){
			return false;
		}
		else{
			HungarianImp hi = new HungarianImp();
			pair = hi.compute(matrix);
			
			//System.err.println("info@Runner>:\n" + pair);
			
			result = YieldCounter.count(pair);
			
			return true;
		}
	}
}
